#TODO 导包
import random
from selenium.webdriver.common.by import By




#TODO  后台登录页面配置数据
#用户名
login_username=By.NAME, 'username'
#密码
login_pwd=By.NAME, 'password'
#验证码
login_verify_code=By.NAME, 'vertify'
#登录按钮
login_btn=By.NAME, 'submit'

#TODO  后台商品管理配置数据
#商城tab菜单
shop_tab=By.LINK_TEXT, '商城'
#商品管理iframe1
iframe1_loc=By.ID, 'workspace'
#添加商品按钮
add_product_button=By.CSS_SELECTOR, 'div[title="添加商品"] span '
#商品名称输入框
product_name_loc=By.NAME, 'goods_name'

#商品简介输入框
product_remark_loc=By.NAME, 'goods_remark'
product_remark="这个商品是自动化生成的"
#商品SPU
product_SPU_loc=By.NAME, 'SPU'
product_SPU='12345{}'.format(random.randint(1,99))
#商品SKU
product_SKU_loc=By.NAME, 'SKU'
product_SKU='678910{}'.format(random.randint(1,99))
#商品分类--写死了（家用电器--生活电器--饮水机）
category01=By.XPATH, '//*[@id="cat_id"]/option[2]'
category02=By.XPATH, '//*[@id="cat_id_2"]/option[2]'
category03=By.XPATH, '//*[@id="cat_id_3"]/option[3]'
#商品品牌--写死了--彪马
product_brand=By.XPATH, '//*[@id="brand_id"]/option[43]'

#商品本店价格
product_shop_price_loc=By.NAME, 'shop_price'
product_shop_price='{}'.format(random.randint(26,75))
#输入商品市场价格
product_market_price_loc=By.NAME, 'market_price'
product_market_price='{}'.format(random.randint(76,99))
#输入商品成本价
product_cost_price_loc=By.NAME, 'cost_price'
product_cost_price='{}'.format(random.randint(1,25))

#商品佣金
product_commission_loc=By.NAME, 'commission'
product_commission='{}'.format(random.randint(1,10))
#上传图片
product_image_loc1=By.CLASS_NAME, 'type-file-file'
iframe5_loc=By.CSS_SELECTOR, 'div[class="layui-layer-content"] iframe'
product_image_loc=By.CSS_SELECTOR, 'div[id="filePicker"] input'
upload_success=By.CLASS_NAME, 'success'
upload_success_btn=By.CLASS_NAME, 'saveBtn'


#商品重量
product_weight_loc=By.CSS_SELECTOR, 'dd[class="opt"] input[name="weight"]'
product_weight='{}'.format(random.randint(1,10))

#商品库存
product_stock_loc=By.NAME,'store_count'
product_stock='{}'.format(random.randint(30,100))

#商品关键字
product_keyword_loc=By.NAME, 'keywords'

#商品描述iframe
iframe6_loc=By.ID,'ueditor_0'

#商品描述
product_detail_loc=By.CSS_SELECTOR, 'html[class="view"] body'
product_detail='这是自动化测试创建的商品描述：_{}'.format(random.randint(30,100))
#点击确认提交按钮
confirm_btn=By.LINK_TEXT, '确认提交'

#搜索框
key_word_loc=By.NAME, 'key_word'
#搜索按钮
search_btn=By.CSS_SELECTOR, 'input[value="搜索"]'
#勾选商品
check_product_loc=By.XPATH,'//*[@id="flexigrid"]/table/tbody/tr/td[1]/div/i'
#删除按钮
del_btn=By.CSS_SELECTOR,'div[title="批量删除"] span'
#确认删除
del_confirm_btn=By.CLASS_NAME,'layui-layer-btn0'